{extend name="public::base" /}
{block name="body" /}
<div class="row">
    <div class="col-md-8">
        <div class="page-header">
            <h2>发布文章</h2>
        </div>
        <form class="form-horizontal" action="{:url('index/index/save')}" method="post" id="login" enctype="multipart/form-data">
            <input type="hidden" name="user_id" value="{$Think.session.user_id}">
            <div class="form-group">
                <label for="title" class="control-label">标题</label>
                <div>
                    <input type="text" name="title" class="form-control" id="title" placeholder="文章标题">
                </div>
            </div>

            <div class="form-group">
                <label for="cate_id" class="control-label">分类</label>
                <select name="cate_id" id="cate_id" class="form-control">
                    {volist name="cateList" id="cate"}
                    <option value="{$cate.id}">{$cate.name}</option>
                    {/volist}
                </select>
            </div>

            <div class="form-group">
                <label for="content" class="control-label">内容</label>
                <textarea class="form-control" name="content" id="content" style="min-height: 250px"></textarea>
            </div>

            <div class="form-group">
                <label for="title_img" class="control-label">标题图片</label>
                <div>
                    <input type="file" name="title_img" class="form-control" id="title_img" placeholder="标题图片">
                </div>
            </div>

            <div class="form-group">
                <button type="submit" class="btn btn-primary" id="register">保存</button>
            </div>
        </form>
    </div>

    <script type="text/javascript">
        bkLib.onDomLoaded(function() {
            new nicEditor({iconsPath : 'http://phpwebtest.com:8888/myblog1/public/static/js/nicEditorIcons.gif'}).panelInstance('content');
        });
    </script>

    {/block}